1 module directx.win32;
2 
3 version(Windows):
4 
5 public import core.sys.windows.windef;
6 public import core.sys.windows.winbase;
7 public import core.sys.windows.mmsystem;
8 public import core.sys.windows.basetyps;
9 
10 pure nothrow @safe @nogc
11 HRESULT MAKE_HRESULT(bool s, uint f, uint c) {
12 	return (s << 31) | (f << 16) | c;
13 }
14 
15 union LARGE_INTEGER {
16 	struct {
17 		uint LowPart;
18 		int  HighPart;
19 	}
20 	long QuadPart;
21 }
22 
23 alias LARGE_INTEGER LUID;
24 alias size_t SIZE_T;
25 
26 alias UINT8 = ubyte;
27 alias UINT16 = ushort;
28 alias UINT32 = uint;
29 alias UINT64 = ulong;
30 
31 alias INT8 = byte;
32 alias INT16 = short;
33 alias INT32 = int;
34 alias INT64 = long;
35 
36 alias HANDLE HMONITOR;
37 alias const(void)* LPCVOID;
38 
39 struct tagSIZE
40 {
41 	LONG        cx;
42 	LONG        cy;
43 } 
44 alias SIZE = tagSIZE;
45 alias PSIZE = tagSIZE*;
46 alias LPSIZE = tagSIZE*;
47 alias SIZEL = SIZE;
48 alias PSIZEL = SIZE*;
49 alias LPSIZEL = SIZE*;
50 
51 // ======= XAudio2 stuff
52 version (HAS_WIN32)
53 {
54 }
55 else
56 {
57 // some predefinitions
58 align(1)
59 struct WAVEFORMATEX
60 {
61 	align(1):
62 	WORD        wFormatTag;         /* format type */
63 	WORD        nChannels;          /* number of channels (i.e. mono, stereo...) */
64 	DWORD       nSamplesPerSec;     /* sample rate */
65 	DWORD       nAvgBytesPerSec;    /* for buffer estimation */
66 	WORD        nBlockAlign;        /* block size of data */
67 	WORD        wBitsPerSample;     /* number of bits per sample of mono data */
68 	WORD        cbSize;             /* the count in bytes of the size of */
69 	/* extra information (after cbSize) */
70 }
71 //WAVEFORMATEX, *PWAVEFORMATEX, NEAR *NPWAVEFORMATEX, FAR *LPWAVEFORMATEX;
72 
73 struct WAVEFORMATEXTENSIBLE
74 {
75 	WAVEFORMATEX Format;          // Base WAVEFORMATEX data
76 	union Samples
77 	{
78 		WORD wValidBitsPerSample; // Valid bits in each sample container
79 		WORD wSamplesPerBlock;    // Samples per block of audio data; valid
80                                   // if wBitsPerSample=0 (but rarely used).
81 		WORD wReserved;           // Zero if neither case above applies.
82 	}
83 	DWORD dwChannelMask;          // Positions of the audio channels
84 	GUID SubFormat;               // Format identifier GUID
85 }
86 
87 } // !version (HAS_WIN32)